﻿<UserControl x:Class="ContactTracing.CaseView.Controls.Analysis.AgeGroupChartCP"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:p="clr-namespace:ContactTracing.CaseView.Properties"
             xmlns:own="clr-namespace:ContactTracing.CaseView"
             xmlns:analysis="clr-namespace:ContactTracing.CaseView.Controls.Analysis"
             xmlns:charting="clr-namespace:ComponentArt.Win.DataVisualization.Charting;assembly=ComponentArt.Win.DataVisualization.Charting"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="500">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="AnalysisStyleDictionary.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
            <StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Center">
            <TextBlock Style="{StaticResource styleTableTitle}" TextAlignment="Center" Text="{x:Static p:Resources.AnalysisAgeGroupCP}" />
            <TextBlock x:Name="tblockCurrentDate" Style="{StaticResource styleTableDateHeading}" />
        </StackPanel>
        <charting:XYChart Grid.Row="1" DataSource="{Binding AgeGroupDataPointCollectionCP}" 
                          x:Name="xyChart"
                          Width="{Binding
                            RelativeSource={RelativeSource
                                Mode=FindAncestor,
                                AncestorType={x:Type analysis:AgeGroupChartCP}},
                                Path=ChartWidth}"
                          Height="420" 
                          Margin="1" 
                          XPath="X" 
                          AnimationOnLoad="False" 
                          CompositionKind="Stacked" 
                          LegendVisible="False"
                          Palette="Deep"
                          DataStructureCreated="xyChart_DataStructureCreated" AnimationCompleted="xyChart_AnimationCompleted" Background="White">
            <charting:XYChart.XAxisArea>
                <!--<charting:AxisScrollBar AxisId="XAxis" x:Name="XScrollBar"/>-->
                <charting:AxisCoordinates x:Name="xAxisCoordinates" Angle="0">
                    <charting:DateTimeCoordinates x:Name="dateTimeCoordinates" LabelAtMidPoint="True" />
                </charting:AxisCoordinates>

                <charting:ChartLabel x:Name="labelXAxis">
                    <StackPanel HorizontalAlignment="Left" VerticalAlignment="Center">
                        <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" x:Name="tblockXAxisLabel" FontWeight="DemiBold" Visibility="Visible" TextAlignment="Center" Padding="4" Text="{x:Static p:Resources.AgeGroup}" />
                    </StackPanel>
                </charting:ChartLabel>
            </charting:XYChart.XAxisArea>

            <charting:XYChart.YAxisArea>

                <charting:AxisCoordinates x:Name="YAxisCoordinates">
                    <charting:NumericCoordinates x:Name="numberCoordinates" />
                </charting:AxisCoordinates>
                

                <charting:ChartLabel x:Name="labelYAxis" Orientation="Vertical" >
                    <StackPanel HorizontalAlignment="Left" VerticalAlignment="Center">
                        <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" x:Name="tblockYAxisLabel" FontWeight="DemiBold" Visibility="Visible" TextAlignment="Center" Text="{x:Static p:Resources.AnalysisChartCaseCount}" />
                    </StackPanel>
                </charting:ChartLabel>
            </charting:XYChart.YAxisArea>
            <charting:XYChart.Axes>
                <charting:Axis Id="YAxis" x:Name="yAxis" UseReferenceValue="true" />
            </charting:XYChart.Axes>
            <charting:BarSeries x:Name="series0" Id="S0" 
                                YPath="Y" 
                                SeriesPath="S" ShowPointAnnotations="True" BarKind="Block" />
        </charting:XYChart>
        
        <StackPanel Grid.Row="2" Margin="0, 5, 0, 10">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>

                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <!--<TextBlock Grid.Row="0" Grid.Column="0" FontSize="11pt" Margin="2" Text="{x:Static p:Resources.AnalysisCasesMissingOnsetDateCP}" />
                <TextBlock x:Name="tblockNumber" Grid.Row="0" Grid.Column="1" FontWeight="Bold" FontSize="11pt" Margin="2"></TextBlock>-->
                
            </Grid>
        </StackPanel>
    </Grid>
</UserControl>
